<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<tiles:importAttribute/>
<html:html>
	
	<head>
		<link rel="SHORTCUT ICON" href="pages/images/favicon.ico"/>
		<link rel="stylesheet" href="pages/main.css" type="text/css"/>
		<link href="general.css" type="text/css" rel="stylesheet"/>
		<meta name="author" content="trainfinder"/>
		<meta name="keywords"
			content="cheap eurostar,eurostar comparison,low price eurostar,train tickets,price comparison,bar chart,scanner,cheapest price,availability,travel,london,france,train,cheap eurostar,best price"/>	
		<META name="verify-v1" content="TjiIKuFNJvOroWZOWkYM/gyRiOrsxqdx1zPzVyJNPRY=" />
		<meta name="description"
			content="Provides you with cheap eurostar tickets displayed in a bar chart."/>
		<meta name="robots" content="ALL, INDEX, FOLLOW"/>
		<meta name="revisit-after" content="1 days"/>
		
		
		1. 	  eurostar
2. 	Eurostar
3. 	paris
4. 	rail
5. 	europe
6. 	Paris
7. 	train
8. 	travel
9. 	online
10. 	Lille
11. 	holidays
12. 	france
13. 	european
14. 	tickets
15. 	london

"tickets paris"
"promotion code eurostar"
		
		
		
		
		<meta http-equiv="Content-Language" content="en-GB"/>
		
		<title>train finder - the eurostar price comparison search engine</title>	
			<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-457443-1";
urchinTracker();
</script>
		<script type="text/javascript">
		<!--
				
	var outwardSelected = null;
	var returnSelected = null;

	var returnDate;
	var returnTime;
	var returnCity;
	var returnPrice;
	var outwardPrice;
	var outwardDate;
	var outwardTime;
	var outwardCity;
	var outwardBarCount
	var returnBarCount			
	
	
	function radioSelectionReturn(item,date,time,city,price) { 
		mouseDownReturn(document.getElementById(item),date,time,city,price );
	}

	function radioSelectionOutward(item,date,time,city,price) { 
		mouseDownOutward(document.getElementById(item),date,time,city,price);
	}

				
	function mouseOutOutward(t) {  
		if (t.getAttribute("bgcolor").toString() != "#eeeeee") { 
			if (outwardSelected==null || outwardSelected != t) {
				drawTable(t,"plain");
			} else {
				 drawTable(t,"pressed");
			}
		}		 
	} 

	function mouseOutReturn(t) {  
		if (t.getAttribute("bgcolor").toString() != "#eeeeee") {
			if (returnSelected==null || returnSelected != t) {
				drawTable(t,"plain");
			} else {
				drawTable(t,"pressed");
			}
		}
	} 
				
				
	function mouseOverOutward(t) { 	
		if (t.getAttribute("bgcolor").toString() != "#eeeeee") {
			if (outwardSelected==null || outwardSelected != t) {
				drawTable(t,"selected");
			} else {
				 drawTable(t,"pressed");
			}
		}
	}
				
	function mouseOverReturn(t) { 	
				
		bgColor = t.getAttribute("bgcolor").toString();
		
		if (bgColor != "#eeeeee") {
			if (returnSelected==null || returnSelected != t) {
				drawTable(t,"selected");
			} else {
				drawTable(t,"pressed");		
			}
		}
	}
				
	function mouseDownOutward(t,date,time,city,price) { 

		bgColor = t.getAttribute("bgcolor").toString();
		
		
		if (bgColor != "#eeeeee") {
			outwardDate = date;
			outwardTime = time;
			outwardCity = city;
			outwardPrice = price
		
			drawTable(t,"pressed");
	
				
			if(outwardSelected != null && outwardSelected != t) {
				drawTable(outwardSelected  ,"plain");
			}
			
			outwardSelected  = t;
			
			returncount = document.getElementById("colcounts").getAttribute("returnBarCount");
			staySaturday = document.getElementById("colcounts").getAttribute("staySaturday");
	 		
	 		if(returncount!=null && staySaturday!=null){	
				if (staySaturday == "AWAY_ON_SATURDAY" ) {
				 	greyUptoDayNumberStayOnSat(parseInt(t.getAttribute("daynumber")),returncount,"ret" );	
				} else {
					greyUptoDayNumberAwayOnSat(parseInt(t.getAttribute("daynumber")),returncount,"ret");	
				}
				setNextActivation();
			}
		} else {
			
			if(parseInt(returnSelected.getAttribute("dayNumber")) <= parseInt(t.getAttribute("dayNumber"))) {
				alert("Your outward journey can must be before your return journey. If you wish to set this as your outward journey please first alter your return departure date.");	
			} else { 	
				staySaturday = document.getElementById("colcounts").getAttribute("staySaturday");
				
				if(staySaturday == "AWAY_ON_SATURDAY") { 
					alert("In the search at the top of the page, you specified that you WILL stay away over a Saturday Night, these price therefore reflect that search. If you wish to book THIS journey please change your departure date of the outward journey, or alter the search to refect that you WILL NOT stay away on saturday.");	
				} else {
					alert("In the search at the top of the page, you specified that you WILL NOT stay away over a Saturday Night, these price therefore reflect that search. If you wish to book THIS journey please change your departure date of the outward journey, or alter the search to refect that you WILL stay away on saturday.");
				}
			}
		}		 
	}
				
	
	function setNextActivation() {
		dayNumberCount = parseInt(document.getElementById("colcounts").getAttribute("dayNumberCount"));
	
		enabled = (outwardSelected != null) && (returnSelected != null);
	
		if (dayNumberCount>0){
				for(var i=1;i<=dayNumberCount;i++) {
					if (enabled) {
						document.getElementById("nextBorder"+i).style.border="2pt solid rgb(255, 234, 66)";
					} else {
						document.getElementById("nextBorder"+i).style.border="";
					}
					document.getElementById("next"+i).disabled=!enabled;
				}
		}				
	}	
	
				
	function setBackground(element,color) {
			
		if (element == outwardSelected) {
			element.bgColor = "#000000";
		} else 	if (element == returnSelected) {
			element.bgColor = "#000000";
		} else if(element.getAttribute("isNotice")!="true") {
			element.bgColor = color;
		}
		
		index = element.getAttribute("index");	
		var radioButton;
		var prefix 
		if (index!=null) {
		
			if (element.getAttribute("id").toString().charAt(0) == 'o'){
				prefix = "radioOutward";
			} else {
				prefix = "radioReturn";
			}	
					
			if(element.bgColor == "#eeeeee") {
	 			document.getElementById(prefix+index).disabled = true;
			}	else {
				document.getElementById(prefix+index).disabled = false;
			}
		}
	}						
		
				
					
	function greyUptoDayNumberStayOnSat(dayNumber,max,prefix) {
	
		foundSat = false;
				
		for(var i=1;i<=max;i++) {
					
			element = document.getElementById(prefix+i.toString());
			value = parseInt(element.getAttribute("dayNumber"));  
				
				
			if ( value < dayNumber )  {
				setBackground(element, "#eeeeee" );
			} else if (value == dayNumber )  {
					setBackground(element, "#eeeeee") ;
					if (element.getAttribute("isSaturday")=="true") {
						foundSat = true;
					}
			} else { 
				pastFirstSat = false;
				for( ;i<=max;) {
					element = document.getElementById(prefix+i);
					
					if (!pastFirstSat && element.getAttribute("isSaturday")=="true") {
							foundSat = true;
							setBackground(element, "#eeeeee") ;
					} else { 
						if (foundSat == true ) {
							 pastFirstSat = true;
							 setBackground(element,"#ffea42") ;
						} else {
							setBackground(element,"#eeeeee" );
						}
					}
					
					i++;
				}
				break;
			}
		}
	}
				
				
	function greyUptoDayNumberAwayOnSat(dayNumber,max,prefix) {
		
		foundSat = false;
		foundfirstSat = false;		
		for(var i=1;i<=max;i++) {	
			element = document.getElementById(prefix+i); 
			if (parseInt(element.getAttribute("dayNumber")) < dayNumber )  {
				setBackground(element,"#eeeeee");
			 
			} else if (parseInt(element.getAttribute("dayNumber")) == dayNumber )  {
				
				if (element.getAttribute("issaturday")=="true") {
					foundSat = true;
				}
				
				setBackground(element,"#eeeeee");
				 
			} else { 
				
				if (!foundfirstSat && element.getAttribute("issaturday")=="true") {
					foundSat = true;
					setBackground(element,"#ffea42");
				} else {
		
					if (foundSat == true ) {
						foundfirstSat = true;
						setBackground(element, "#eeeeee");
					} else {
						setBackground(element,"#ffea42");
					}
				}				
			}
		}
	}
			
				
				
	function mouseDownReturn(t,date,time,city,price) { 
	
		bgColor = t.getAttribute("bgcolor").toString();
	
	
	
		
		if (bgColor != "#eeeeee") {
		
			drawTable(t,"pressed");
	
			index = t.getAttribute("index").toString();	
			document.getElementById("radioReturn"+index).checked = true;
	
		
			returnDate = date;
			returnTime = time;
			returnCity = city;
			returnPrice = price;
		
			
			if(returnSelected != null && returnSelected != t ) {
				drawTable(returnSelected  ,"plain");
			}
			
			returnSelected  = t;
		 
			staySaturday = document.getElementById("colcounts").getAttribute("staySaturday");
			outwardcount = document.getElementById("colcounts").getAttribute("outwardBarCount");
			if(outwardcount!=null && staySaturday!=null){	
				if (staySaturday == "AWAY_ON_SATURDAY" ) {
					greyBehondDayNumberAwayOnSat(parseInt(t.getAttribute("daynumber")),outwardcount,"out" );	
						 
				} else {	
					greyBehondDayNumberHomeOnSat(parseInt(t.getAttribute("daynumber")),outwardcount,"out" );	
				}
				
				setNextActivation();
			}
		} else {
			outwardValue = parseInt(outwardSelected.getAttribute("dayNumber"));
			dayNum = parseInt(t.getAttribute("dayNumber"));
			if(outwardValue >= dayNum) {
				alert("Your return journey can not be before your outward departure journey. If you wish to set this as your return journey please first alter your outward departure date.");	
			} else { 	
				staySaturday = document.getElementById("colcounts").getAttribute("staySaturday");
				
				if(staySaturday == "AWAY_ON_SATURDAY") { 
					alert("In the search at the top of the page, you specified that you WILL stay away over a Saturday Night, these price therefore reflect that search. If you wish to book THIS journey please change your departure date of the outward journey, or alter the search to refect that you WILL NOT stay away on saturday.");	
				} else {
					alert("In the search at the top of the page, you specified that you WILL NOT stay away over a Saturday Night, these price therefore reflect that search. If you wish to book THIS journey please change your departure date of the outward journey, or alter the search to refect that you WILL stay away on saturday.");
				}
			}
		}		 
	}
				
				
				
	function greyBehondDayNumberHomeOnSat(dayNumber,max,prefix) {
		
		foundSat = false;
				
		for(var i=max;i>1;i--) {	
			element = document.getElementById(prefix+i); 
			if (element.getAttribute("dayNumber") > dayNumber )  {
				setBackground(element,"#eeeeee");
			 
			} else if (element.getAttribute("dayNumber") == dayNumber )  {
				
				if (element.getAttribute("issaturday")=="true") {
					foundSat = true;
				}
				
				setBackground(element,"#eeeeee");
				 
			} else { 
				if (element.getAttribute("issaturday")=="true") {
					foundSat = true;
				}
			
				if (foundSat == true ) {
					setBackground(element, "#eeeeee");
				}
				else {
					setBackground(element, "#ffea42" );
				}
			}
		}
	}
				
				
	function greyBehondDayNumberAwayOnSat(dayNumber,max,prefix) {
		
		foundSat = false;
				
		for(var i=max;i>1;i--) {	
			element = document.getElementById(prefix+i); 
			if (parseInt(element.getAttribute("dayNumber")) > dayNumber )  {
				setBackground(element,"#eeeeee");
			 
			} else if (parseInt(element.getAttribute("dayNumber")) == dayNumber )  {
				
				if (element.getAttribute("issaturday")=="true") {
					for( ;i<=max;) {
					 
						element = document.getElementById(prefix+i);
					
						if (element.getAttribute("isSaturday")=="true") {
							setBackground(element, "#eeeeee");
						} else { 
							setBackground(element,"#ffea42");
						}
						
						i++;
					}
					break;
				}
				else {
					setBackground(element,"#eeeeee");
				}
				
				 
			} else { 
				if (element.getAttribute("issaturday")=="true") {
					foundSat = true;
				}
				if (foundSat == true ) {
					setBackground(element, "#ffea42");
				}
				else {
					setBackground(element, "#eeeeee");
				}
			}
		}
	}
	
	function drawTable(t,type) { 
		
		
	
		if(type=="plain") {
			t.bgColor ="#ffea42";
		} else 	if(type=="pressed")	{
			t.bgColor = "#000000";
			
			index = t.getAttribute("index").toString();	
			
			if (t.getAttribute("id").toString().charAt(0) == 'o'){
					document.getElementById("radioOutward"+index).checked = true;
			} else {
					document.getElementById("radioReturn"+index).checked = true;
			}			
		} else 	if(type=="selected") {
			t.bgColor = "#888888";
		}

	}
		
	function submitEurostarBooking() {
 	
		 form = document.getElementById("bookingForm");
 
		document.getElementById("td_departureCity").value = outwardCity;
		document.getElementById("td_arrivalCity").value = returnCity;	
		document.getElementById("td_outwardDate").value = outwardDate;
		document.getElementById("td_outwardTime").value = outwardTime;
		document.getElementById("td_returnDate").value = returnDate;
		document.getElementById("td_returnTime").value = returnTime;
		document.getElementById("td_returnPrice1").value = returnPrice1;
		document.getElementById("td_outwardPrice1").value = outwardPrice1;
				document.getElementById("td_returnPrice2").value = returnPrice2;
		document.getElementById("td_outwardPrice2").value = outwardPrice2;
		document.getElementById("td_nbPaxChild").value = 0;
		document.getElementById("td_nbPaxYouth").value = 0;
		document.getElementById("td_nbPaxSenior").value = 0;
		document.getElementById("td_nbPaxAdult").value = 1;
		
		form.submit();
	}		
						
			google_ad_client = "pub-5107714513050617";
			google_ad_width = 160;
			google_ad_height = 600;
			google_ad_format = "160x600_as";
			google_ad_type = "text";
			google_ad_channel ="";
			google_color_border = "FFFFFF";
			google_color_link = "000000";
			google_color_bg = "FFFFFF";
			google_color_text = "666666";
			google_color_url = "666666";
				
				
			
 		
				
		//--></script>
		
	</head>
	<body >
		<a name="top"/>
		<!-- main layout -->
		<table>
			<tr>
				<td width="900" align="center">
					<tiles:get name="menu"/>
				</td>
				
			</tr>
			
			<tr>
				<td height="10"/ >
				
			</tr>
			
			<tr>
				<td>
					<tiles:get name="content"/>
				</td>
			</tr>
		</table>
		
	</body>
</html:html>